<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%--引用标签--%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<%@ include file="/WEB-INF/include/head.basic.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>数据查询</title>
<script type="text/javascript">
	function logout(id){
		$.messager.confirm("确认删除", "确认删除吗？", function (r) {
			if (r) {
				$.ajax({
					url :'logoutUser/'+id,
					type:'GET',
					dataType:'json',
					success:function(data){
						if(data.code == '0'){
							$.messager.alert('提示', data.message, 'warning',function(){
								location.reload();
							});
						}else if(data.code == '1'){
							$.messager.alert('提示', data.message, 'error');
						}
					}
				});
			}
		});
	}
</script>
</head>
<body>
<div id="tipInfos"></div>
<table id="stupidtable" width="100%" align="center" class="table">
	<thead>
		<tr>
			<th>序号</th>
			<th>会话ID</th>
			<th>用户名</th>
			<th>主机地址</th>
			<th>最后访问时间</th>
			<th>已强制退出</th>
			<th>操作</th>
		</tr>
	</thead>
	<tbody>
		<c:forEach items="${sessions}" var="bean" varStatus="status">
			<tr onmouseover="this.bgColor='#EAF2FF'" onmouseout="this.bgColor='#FFFFFF'" align="center">
            <th style="background-size: 100%;">${status.index + 1}</th>
            <td align="left">${bean.sessionId}</td>
            <td align="left">${bean.username}</td>
            <td align="left">${bean.host}</td>
            <td align="left"><fmt:formatDate value="${bean.lastAccessTime}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
            <td align="left">${bean.logout ? '是' : '否'}</td>
            <td align="center">
				<c:if test="${bean.logout == false}">
					<a href="###" class="easyui-linkbutton" data-options="iconCls:'icon-remove'" onclick="logout('${bean.sessionId}')">强制退出</a>
				</c:if>
            </td>
		</c:forEach>
	</tbody>
</table>
</body>
</html>